package org.wiztools.commons.feed;

import java.util.Collections;
import java.util.Map;

/**
 *
 * @author subhash
 */
public final class Options {
    private boolean isHttpAuth = false;

    // HTTP Authentication:
    private String httpAuthUsername;
    private String httpAuthPassword;
    
    // Cookie propagation for SSO:
    private Map<String, String> cookies;

    public void setHttpAuthentication(final String username, final String password){
        isHttpAuth = true;
        httpAuthUsername = username;
        httpAuthPassword = password;
    }

    public boolean isHttpAuthEnabled(){
        return isHttpAuth;
    }

    public String getHttpAuthUsername(){
        return httpAuthUsername;
    }

    public String getHttpAuthPassword(){
        return httpAuthPassword;
    }



    public void setHttpCookies(Map<String, String> cookies){
        this.cookies = cookies;
    }

    public Map<String, String> getHttpCookies(){
        return Collections.unmodifiableMap(cookies);
    }

    public boolean isCookiesSet(){
        if(cookies == null){
            return false;
        }
        return true;
    }
}
